<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Target extends MY_Controller {

	function __construct()
	{
		parent::__construct();
		
		
	}

	function index()
	{
		if ($this->uri->segment(2) === FALSE)
		{
			redirect('news');
		}
		else
		{
			$target_name = urldecode($this->uri->segment(2));
			//$target = $this->targets->load_by_name($target_name);
		}
		$data['target_name'] = $target_name;
	    $data['query'] = $this->articles->get_articles_for_target_by_name($target_name, 15);
		
        $target = array('name'=>$target_name);
        
        $b = array ();
        $b[] = $this->UserFeed();
        $b[] = $this->BoxRecent($target);
        $b[] = $this->BoxFeatured();
		
        $data2['boxes'] = $b;


	
		$this->ShowHeader();
		$this->load->view('main_page', $data);
		$this->load->view('box_frame', $data2);
		$this->ShowFooter();
	}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */